import { InjectQueue } from '@nestjs/bull';
import { Inject, Injectable } from '@nestjs/common';
import { Job, Queue } from 'bull';
import { Model } from 'mongoose';

@Injectable()
export class QueuesService {
	constructor(
		@InjectQueue('message-queue') private queue: Queue,
	) {}

	async sendMessage(message:string){
		await this.queue.add('message-job',{
			text: message
		},{
			delay:0//延时执行 毫秒
		});
	}

}
